package com.mineoj.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mineoj.model.dto.solutioncomment.SolutionCommentAddRequest;
import com.mineoj.model.dto.solutioncomment.SolutionCommentQueryRequest;
import com.mineoj.model.entity.User;
import com.mineoj.model.entity.SolutionComment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mineoj.model.vo.SolutionCommentVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 明月
* @description 针对表【solution_comment(题解评论)】的数据库操作Service
* @createDate 2025-04-05 16:15:45
*/
public interface SolutionCommentService extends IService<SolutionComment> {
    /**
     * 添加评论
     * @param solutionCommentAddRequest 评论信息
     * @param loginUser 登录用户
     * @return 评论ID
     */
    long doSolutionComment(SolutionCommentAddRequest solutionCommentAddRequest, User loginUser);

    /**
     * 删除评论
     * @param id 评论ID
     * @param loginUser 登录用户
     * @return 是否删除成功
     */
    boolean deleteSolutionComment(long id, User loginUser);

    /**
     * 获取评论封装
     * @param solutionComment 评论
     * @param loginUser 登录用户
     * @return 评论VO
     */
    SolutionCommentVO getSolutionCommentVO(SolutionComment solutionComment, User loginUser);

    /**
     * 分页获取题解评论
     * @param solutionCommentPage 分页对象
     * @param request 请求
     * @return 分页结果
     */
    Page<SolutionCommentVO> getSolutionCommentVOPage(Page<SolutionComment> solutionCommentPage, HttpServletRequest request);


}
